inherited sprTowns: TsprTowns
  HelpContext = 1153
  Caption = #1057#1087#1088#1072#1074#1086#1095#1085#1080#1082' '#1085#1072#1089#1077#1083#1077#1085#1085#1099#1093' '#1087#1091#1085#1082#1090#1086#1074
  PixelsPerInch = 96
  TextHeight = 13
  inherited Panel2: TPanel
    Top = 89
    Height = 465
    inherited PageControl1: TPageControl
      Height = 465
      inherited tsTab: TTabSheet
        inherited GroupBox3: TGroupBox
          Height = 437
          Caption = ' '#1053#1072#1089#1077#1083#1077#1085#1085#1099#1077' '#1087#1091#1085#1082#1090#1099' '
          inherited dbgRefer: TDBGridEh
            Height = 420
            Columns = <
              item
                EditButtons = <>
                FieldName = 'ID'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'NAME'
                Footers = <>
                Width = 116
              end
              item
                EditButtons = <>
                FieldName = 'CODECALL'
                Footers = <>
                Width = 94
              end
              item
                EditButtons = <>
                FieldName = 'CODECALLADD'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'REFSERVICE'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'CODE'
                Footers = <>
                Width = 52
              end
              item
                Checkboxes = True
                EditButtons = <>
                FieldName = 'LOCAL'
                Footers = <>
                Width = 72
              end
              item
                EditButtons = <>
                FieldName = 'FULL_NAME'
                Footers = <>
                Width = 154
              end
              item
                EditButtons = <>
                FieldName = 'TT_TOWNTYPE'
                Footers = <>
              end
              item
                EditButtons = <>
                FieldName = 'TT_SHORT_TOWNTYPE'
                Footers = <>
                Width = 60
              end
              item
                EditButtons = <>
                FieldName = 'AREA_NAME'
                Footers = <>
                Width = 88
              end
              item
                EditButtons = <>
                FieldName = 'TOWN_TYPE_ID'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'TOWN_AREA'
                Footers = <>
                Visible = False
              end
              item
                EditButtons = <>
                FieldName = 'REGION'
                Footers = <>
                Width = 92
              end>
          end
        end
      end
      inherited tsForm: TTabSheet
        inherited GroupBox2: TGroupBox
          Top = 0
          Width = 784
          Height = 437
          Align = alClient
          object Label1: TLabel [0]
            Left = 84
            Top = 15
            Width = 17
            Height = 13
            Alignment = taRightJustify
            Caption = #1048#1044
          end
          object Label2: TLabel [1]
            Left = 51
            Top = 35
            Width = 50
            Height = 13
            Alignment = taRightJustify
            Caption = #1053#1072#1079#1074#1072#1085#1080#1077
          end
          object Label3: TLabel [2]
            Left = 15
            Top = 55
            Width = 86
            Height = 13
            Alignment = taRightJustify
            Caption = #1058#1077#1083#1077#1092#1086#1085#1085#1099#1081' '#1082#1086#1076
          end
          object Label4: TLabel [3]
            Left = 56
            Top = 75
            Width = 45
            Height = 13
            Alignment = taRightJustify
            Caption = #1044#1086#1087'. '#1082#1086#1076
          end
          object Label5: TLabel [4]
            Left = 41
            Top = 95
            Width = 60
            Height = 13
            Alignment = taRightJustify
            Caption = #1057#1087#1088#1072#1074#1086#1095#1085#1072#1103
          end
          object Label6: TLabel [5]
            Left = 54
            Top = 115
            Width = 47
            Height = 13
            Hint = #1082#1086#1076' '#1076#1083#1103' '#1074#1085#1077#1096#1085#1080#1093' '#1082#1083#1102#1095#1077#1081
            Alignment = taRightJustify
            Caption = #1050#1086#1076'-'#1082#1083#1102#1095
          end
          object Label7: TLabel [6]
            Left = 12
            Top = 155
            Width = 89
            Height = 13
            Hint = #1082#1086#1076' '#1076#1083#1103' '#1074#1085#1077#1096#1085#1080#1093' '#1082#1083#1102#1095#1077#1081
            Alignment = taRightJustify
            Caption = #1055#1086#1083#1085#1086#1077' '#1085#1072#1079#1074#1072#1085#1080#1077
          end
          object Label8: TLabel [7]
            Left = 24
            Top = 175
            Width = 77
            Height = 13
            Alignment = taRightJustify
            Caption = #1058#1080#1087' '#1085#1072#1089'.'#1087#1091#1085#1082#1090#1072
          end
          object Label9: TLabel [8]
            Left = 12
            Top = 195
            Width = 89
            Height = 13
            Alignment = taRightJustify
            Caption = #1056#1072#1081#1086#1085' '#1085#1072#1089'.'#1087#1091#1085#1082#1090#1072
          end
          inherited pnlButtons: TPanel
            Top = 404
            Width = 780
            TabOrder = 10
            inherited SpeedButton1: TSpeedButton
              Left = 581
            end
            inherited SpeedButton2: TSpeedButton
              Left = 683
            end
          end
          object DBEditEh1: TDBEditEh
            Left = 104
            Top = 12
            Width = 57
            Height = 19
            AlwaysShowBorder = True
            Color = clInactiveCaptionText
            DataField = 'ID'
            DataSource = dscRefer
            EditButtons = <>
            Enabled = False
            Flat = True
            ReadOnly = True
            TabOrder = 0
            Visible = True
          end
          object DBCheckBoxEh1: TDBCheckBoxEh
            Left = 35
            Top = 132
            Width = 82
            Height = 17
            Hint = #1055#1086' '#1085#1072#1089'.'#1087#1091#1085#1082#1090#1091' '#1074' '#1041#1044'  '#1074#1077#1076#1077#1090#1089#1103' '#1091#1095#1077#1090' '#1072#1073#1086#1085#1077#1085#1090#1086#1074
            Alignment = taLeftJustify
            AlwaysShowBorder = True
            Caption = #1042#1077#1076#1077#1090#1089#1103' '#1091#1095#1077#1090
            DataField = 'LOCAL'
            DataSource = dscRefer
            Flat = True
            TabOrder = 6
            ValueChecked = '1'
            ValueUnchecked = '0'
            OnClick = DBEditEhChange
          end
          object DBEditEh4: TDBEditEh
            Left = 104
            Top = 72
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'CODECALLADD'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 3
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBEditEh5: TDBEditEh
            Left = 104
            Top = 92
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'REFSERVICE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 4
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBEditEh6: TDBEditEh
            Left = 104
            Top = 112
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'CODE'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 5
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBEditEh2: TDBEditEh
            Left = 104
            Top = 32
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'NAME'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 1
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBEditEh3: TDBEditEh
            Left = 104
            Top = 52
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'CODECALL'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 2
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBLookupComboboxEh1: TDBLookupComboboxEh
            Left = 104
            Top = 172
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'TOWN_TYPE_ID'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            KeyField = 'ID'
            ListField = 'NAME'
            ListSource = dscTownTypes
            TabOrder = 8
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBEditEh7: TDBEditEh
            Left = 104
            Top = 152
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'FULL_NAME'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            TabOrder = 7
            Visible = True
            OnChange = DBEditEhChange
          end
          object DBLookupComboboxEh2: TDBLookupComboboxEh
            Left = 104
            Top = 192
            Width = 217
            Height = 19
            AlwaysShowBorder = True
            DataField = 'TOWN_AREA'
            DataSource = dscRefer
            EditButtons = <>
            Flat = True
            KeyField = 'ID'
            ListField = 'AREA_NAME'
            ListSource = dscTownArea
            TabOrder = 9
            Visible = True
            OnChange = DBEditEhChange
          end
        end
      end
    end
  end
  inherited GroupBox1: TGroupBox
    Height = 64
    object Label10: TLabel
      Left = 52
      Top = 20
      Width = 50
      Height = 13
      Caption = #1053#1072#1079#1074#1072#1085#1080#1077
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
    end
    object eNameSearch: TDBEditEh
      Left = 108
      Top = 18
      Width = 181
      Height = 19
      AlwaysShowBorder = True
      EditButtons = <>
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      Flat = True
      ParentFont = False
      TabOrder = 0
      Visible = True
      OnChange = eNameSearchChange
    end
    object cbLocalSearch: TDBCheckBoxEh
      Left = 36
      Top = 40
      Width = 85
      Height = 17
      Alignment = taLeftJustify
      AlwaysShowBorder = True
      Caption = #1042#1077#1076#1077#1090#1089#1103' '#1091#1095#1077#1090
      Flat = True
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
      TabOrder = 1
      ValueChecked = 'True'
      ValueUnchecked = 'False'
      OnClick = eNameSearchChange
    end
  end
  inherited shblActionList: TActionList
    Left = 280
    Top = 12
  end
  inherited dsRefer: TpFIBDataSet
    UpdateSQL.Strings = (
      'UPDATE PAS_RTOWN'
      'SET '
      '    NAME = :NAME,'
      '    TOWN_TYPE_ID = :TOWN_TYPE_ID,'
      '    CODECALL = :CODECALL,'
      '    CODECALLADD = :CODECALLADD,'
      '    REFSERVICE = :REFSERVICE,'
      '    CODE = :CODE,'
      '    LOCAL = :LOCAL,'
      '    TOWN_AREA = :TOWN_AREA'
      'WHERE'
      '    ID = :OLD_ID'
      '    ')
    DeleteSQL.Strings = (
      'DELETE FROM'
      '    PAS_RTOWN'
      'WHERE'
      '        ID = :OLD_ID'
      '    ')
    InsertSQL.Strings = (
      'INSERT INTO PAS_RTOWN('
      '    NAME,'
      '    TOWN_TYPE_ID,'
      '    CODECALL,'
      '    CODECALLADD,'
      '    REFSERVICE,'
      '    CODE,'
      '    LOCAL,'
      '    TOWN_AREA'
      ')'
      'VALUES('
      '    :NAME,'
      '    :TOWN_TYPE_ID,'
      '    :CODECALL,'
      '    :CODECALLADD,'
      '    :REFSERVICE,'
      '    :CODE,'
      '    :LOCAL,'
      '    :TOWN_AREA'
      ')')
    RefreshSQL.Strings = (
      'select t.*, tt.name as town_type'
      'from pas_rtown t, pas_rtown_type tt'
      'where(  t.town_type_id = tt.id'
      '     ) and (     T.ID = :OLD_ID'
      '     )'
      '    ')
    SelectSQL.Strings = (
      'select '
      '  t.*, '
      '  tt.name as tt_towntype, '
      '  tt.short_name as tt_short_towntype,'
      '  ta.area_name,'
      '  ta.region'
      'from pas_rtown t'
      ' left join pas_rtown_type tt on t.town_type_id = tt.id'
      ' left join rtown_areas ta on ta.id = t.TOWN_AREA'
      'where 1 = 1')
    BeforeEdit = dsReferBeforeEdit
    object dsReferID: TFIBIntegerField
      DisplayLabel = #1048#1044
      FieldName = 'ID'
    end
    object dsReferNAME: TFIBStringField
      DisplayLabel = #1053#1072#1079#1074#1072#1085#1080#1077
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReferCODECALL: TFIBStringField
      DisplayLabel = #1058#1077#1083#1077#1092#1086#1085#1085#1099#1081' '#1082#1086#1076
      FieldName = 'CODECALL'
      Size = 10
      EmptyStrToNull = True
    end
    object dsReferCODECALLADD: TFIBStringField
      DisplayLabel = #1044#1086#1087'.'#1082#1086#1076
      FieldName = 'CODECALLADD'
      Size = 10
      EmptyStrToNull = True
    end
    object dsReferREFSERVICE: TFIBStringField
      DisplayLabel = #1057#1087#1088#1072#1074#1086#1095#1085#1072#1103
      FieldName = 'REFSERVICE'
      Size = 10
      EmptyStrToNull = True
    end
    object dsReferCODE: TFIBIntegerField
      DisplayLabel = #1050#1086#1076'-'#1082#1083#1102#1095
      FieldName = 'CODE'
    end
    object dsReferLOCAL: TFIBSmallIntField
      DefaultExpression = '0'
      DisplayLabel = #1042#1077#1076#1077#1090#1089#1103' '#1091#1095#1077#1090
      FieldName = 'LOCAL'
    end
    object dsReferFULL_NAME: TFIBStringField
      DisplayLabel = #1055#1086#1083#1085#1086#1077' '#1085#1072#1079#1074#1072#1085#1080#1077
      FieldName = 'FULL_NAME'
      Size = 123
      EmptyStrToNull = True
    end
    object dsReferTT_TOWNTYPE: TFIBStringField
      DisplayLabel = #1058#1080#1087' '#1085#1072#1089'.'#1087#1091#1085#1082#1090#1072
      FieldName = 'TT_TOWNTYPE'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReferTT_SHORT_TOWNTYPE: TFIBStringField
      DisplayLabel = #1050#1088#1072#1090#1082'. '#1090#1080#1087
      FieldName = 'TT_SHORT_TOWNTYPE'
      Size = 16
      EmptyStrToNull = True
    end
    object dsReferAREA_NAME: TFIBStringField
      DisplayLabel = #1056#1072#1081#1086#1085
      FieldName = 'AREA_NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object dsReferTOWN_TYPE_ID: TFIBIntegerField
      FieldName = 'TOWN_TYPE_ID'
      Visible = False
    end
    object dsReferTOWN_AREA: TFIBIntegerField
      DefaultExpression = '0'
      FieldName = 'TOWN_AREA'
      Visible = False
    end
    object dsReferREGION: TFIBStringField
      DisplayLabel = #1054#1073#1083#1072#1089#1090#1100'('#1089#1087#1088'.)'
      FieldName = 'REGION'
      Size = 60
      EmptyStrToNull = True
    end
  end
  object dsTownTypes: TpFIBDataSet [8]
    SelectSQL.Strings = (
      
        'select tt.id, tt.name || coalesce('#39' ('#39'||tt.short_name||'#39')'#39', '#39#39') ' +
        'as name'
      'from pas_rtown_type tt')
    Transaction = trLists
    Database = MAINDM.pMainDatabase
    Left = 476
    Top = 165
    object dsTownTypesID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTownTypesNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 79
      EmptyStrToNull = True
    end
  end
  object dsTownArea: TpFIBDataSet [9]
    SelectSQL.Strings = (
      
        'select ta.id, ta.area_name || coalesce('#39' ('#39'||ta.region||'#39')'#39', '#39#39')' +
        ' as area_name'
      'from RTOWN_AREAS ta')
    Transaction = trLists
    Database = MAINDM.pMainDatabase
    Left = 536
    Top = 165
    object dsTownAreaID: TFIBIntegerField
      FieldName = 'ID'
    end
    object dsTownAreaAREA_NAME: TFIBStringField
      FieldName = 'AREA_NAME'
      Size = 123
      EmptyStrToNull = True
    end
  end
  object dscTownTypes: TDataSource [10]
    DataSet = dsTownTypes
    Left = 476
    Top = 217
  end
  object dscTownArea: TDataSource [11]
    DataSet = dsTownArea
    Left = 532
    Top = 217
  end
  inherited PropStorage: TPropStorageEh
    Section = 'sprTowns'
    Left = 240
    Top = 12
  end
end
